package com.lagou.util;

public class StringUtils {


    /**
     * 获取指定长度的数字验证码
     *
     * @param length 长度
     * @return
     */
    public static String getValidCode(int length) {
        String res = "";
        if (length <= 18 && length > 0) {
            res = (Math.random() + "").substring(2, 2 + length);
        }
        return res;
    }


}
